/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package org.merak.example.business;

import org.merak.core.web.HttpRequest;
import org.merak.core.web.HttpResponse;
import org.merak.core.web.mvc.PublicBusinessLogic;

public class HelloWorld extends PublicBusinessLogic {

	//~ Attributes ///////////////////////////////////////////////////////////////
	//****************************************************************************
	private final static String view = "/WEB-INF/pages/hello_world.jsp";

	//~ Methods //////////////////////////////////////////////////////////////////
	//****************************************************************************
//	@NotNull(
//		parameters     = {"name{2,6}","file{6,10}"},
//		message        = "msg:O campo %1 precisa ser preenchido.",
//		messageIfSmall = "msg:O campo %1 não pode ser menor que %2.",
//		messageIfLarge = "msg:O campo %1 não pode ser maior que %2."
//	)
	@Override
	public String execute(HttpRequest request, HttpResponse response)
		throws Exception
	{
		// Web Parameters
//	    WebParameter pNome = request.getWebParameter("name");
//	    WebParameter pFile = request.getWebParameter("file");
//
//	    System.out.println( FrontController.getCurrentHttpSession() );

	    // Upload the file
//    	File uploaded = pFile.getFile();
//    	request.setAttribute("nome", pNome.getValue());
//    	request.setAttribute("file", uploaded);
		return view;
	}
	//****************************************************************************

}
